package com.hymake.pipeline;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.hymake.dao.Dy2018Dao;
import com.hymake.model.Dy2018Repo;

import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

@Component("dy2018DaoPipeline")
public class Dy2018DaoPipeline implements Pipeline {

	@Autowired
	private Dy2018Dao dy2018Dao;

	public void process(ResultItems resultItems, Task task) {
		Dy2018Repo dy2018Repo = resultItems.get("repo");
		if(dy2018Repo != null)
			dy2018Dao.save(dy2018Repo);
	}
}
